<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>images slide with offset</title>
<script src="../jQuery/jquery_1.4.2.js" type="text/javascript"></script>
<style>
#slide_box{width:400px;height:225px;overflow:hidden;border:1px solid red;position:relative;}
img{margin:0px;float:left;}
#nav{position:absolute;right:5px;bottom:5px;z-index:10;}
#nav .nav_num{padding:3px;float:left;margin-right:5px;border:1px solid red;}
</style>
</head>

<body>
<div id="slide_box">
	<table id="images">
		<tr><td><img src="../images/p5.jpg" /></td><td><img src="../images/p8.jpg" /></td></tr>
	</table>
</div>
</body>
<script>
$(function(){
	var slide = $('#slide_box'),images = $('#images'),tr=$('#images tr'),offset_width = images.get(0).offsetWidth;	
	tr.html(tr.html()+tr.html());
	function scroll_fun(){
		if(slide.get(0).scrollLeft>=offset_width){
			slide.get(0).scrollLeft = 0
		}else{
			slide.get(0).scrollLeft++
		}
	}
	var mySlide = setInterval(scroll_fun,30);
	slide.mouseover(function(){clearInterval(mySlide)});
	slide.mouseout(function(){mySlide = setInterval(scroll_fun,30)});
});
</script>
</html>
